<?php

namespace App\Extensions\Widgets;

use Encore\Admin\Facades\Admin;
use Encore\Admin\Widgets\Box;

class EBox extends Box
{
    /**
     * Variables in view.
     *
     * @return array
     */
    protected function variables()
    {
        return [
            'title'      => $this->title,
            'content'    => $this->content,
            'footer'     => $this->footer,
            'tools'      => $this->tools,
            'attributes' => $this->formatAttributes(),
            'script'     => $this->script(),
        ];
    }

    protected function script(): string
    {
        Admin::script($this->script);
        return '';
    }

}
